package Test;

/**
 * Created with IntelliJ IDEA.
 * User: happyiu
 * Date: 2022-03-05
 * Time: 10:34
 * Description:
 */
public class TestDemo {
    public static void main1(String[] args) {
        Integer a = 123;//装箱  装包【隐式的】
        int b = a;//拆箱  拆包【隐式的】
        System.out.println("a="+a+" b=" + b);
        //a=123 b=123

        Integer a2 = Integer.valueOf(123);//显示的装包
        Integer a3 = new Integer(123);//显示的装包

    }

    public static void main2(String[] args) {
        Integer a2 = Integer.valueOf(123);//显示的装包
        Integer a3 = new Integer(123);//显示的装包

        int b2 = a2.intValue();//显示的拆包
        double d = a2.doubleValue();//显示的拆包
    }

    public static void main(String[] args) {
        Integer a = 128;
        Integer b = 128;
        System.out.println(a == b);
    }

}
